<html><head><title>InsertXMLList</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">InsertXMLList()</font></b></p>
<p><b>Syntax</b></p><blockquote>
Result = <font color="#3A3966"><b>InsertXMLList</b></font>(ParentNode, List() [, PreviousNode])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>

Insert the specified List() as a new XML node into the given parent node. 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>ParentNode</i></td>
<td width="90%"> 
The node into which to insert the new node. To insert the new node 
at the root of the tree, <a href="rootxmlnode.html">RootXMLNode()</a> can be used here. 

</td></tr>
<tr><td><i>List()</i></td>
<td> 
The list to insert into the XML. 

</td></tr>
<tr><td><i>PreviousNode (optional)</i></td>
<td> 
A childnode of 'ParentNode' after which the new node should 
be inserted. If this value is 0 or not specified, the new node is inserted as the first child of 
its parent. If this value is -1, the node is inserted as the last child of its parent. 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>

The new XML node if it was created successfully or zero if no node could 
be inserted at this point. 

</blockquote><p><b>Remarks</b></p><blockquote>

The rules specified in the <a href="createxmlnode.html">CreateXMLNode()</a> for where a new node can be inserted 
also apply to this function. 
<br>
<br>
The inserted node is named &quot;list&quot; and the contained element nodes are named &quot;element&quot;. 
See below for an example of the created XML. 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; This example produces the following XML tree:</font>
  <font color="#3A3966">;</font>
  <font color="#3A3966">; &lt;list&gt;</font>
  <font color="#3A3966">;   &lt;element&gt;square&lt;/element&gt;</font>
  <font color="#3A3966">;   &lt;element&gt;circle&lt;/element&gt;</font>
  <font color="#3A3966">;   &lt;element&gt;triangle&lt;/element&gt;</font>
  <font color="#3A3966">; &lt;/list&gt;</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Shapes$</font>()
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Shapes$</font>()):<font color="#3A3966"> Shapes$</font>() = &quot;square&quot;
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Shapes$</font>()):<font color="#3A3966"> Shapes$</font>() = &quot;circle&quot;
<font color="#3A3966">  AddElement</font>(<font color="#3A3966">Shapes$</font>()):<font color="#3A3966"> Shapes$</font>() = &quot;triangle&quot;

  <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateXML</font>(0)
<font color="#3A3966">    InsertXMLList</font>(<font color="#3A3966">RootXMLNode</font>(0),<font color="#3A3966"> Shapes$</font>())
<font color="#3A3966">    FormatXML</font>(0, <font color="#924B72">#PB_XML_ReFormat</font>)
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">ComposeXML</font>(0)
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; This example produces the following XML tree:</font>
  <font color="#3A3966">;</font>
  <font color="#3A3966">; &lt;list&gt;</font>
  <font color="#3A3966">;   &lt;element&gt;</font>
  <font color="#3A3966">;     &lt;x&gt;100&lt;/x&gt;</font>
  <font color="#3A3966">;     &lt;y&gt;200&lt;/y&gt;</font>
  <font color="#3A3966">;   &lt;/element&gt;</font>
  <font color="#3A3966">;   &lt;element&gt;</font>
  <font color="#3A3966">;     &lt;x&gt;200&lt;/x&gt;</font>
  <font color="#3A3966">;     &lt;y&gt;400&lt;/y&gt;</font>
  <font color="#3A3966">;   &lt;/element&gt;</font>
  <font color="#3A3966">; &lt;/list&gt;</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">Structure</font></b> Position
    x.l
    y.l
  <b><font color="#3A3966">EndStructure</font></b>
  
  <b><font color="#3A3966">NewList</font></b> <font color="#3A3966">Positions</font>.Position()
  
  <b><font color="#3A3966">For</font></b> i = 1 <b><font color="#3A3966">To</font></b> 2
<font color="#3A3966">    AddElement</font>(<font color="#3A3966">Positions</font>())
<font color="#3A3966">    Positions</font>()\x = 100 * i
<font color="#3A3966">    Positions</font>()\y = 200 * i
  <b><font color="#3A3966">Next</font></b> i

  <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateXML</font>(0)
<font color="#3A3966">    InsertXMLList</font>(<font color="#3A3966">RootXMLNode</font>(0),<font color="#3A3966"> Positions</font>())
<font color="#3A3966">    FormatXML</font>(0, <font color="#924B72">#PB_XML_ReFormat</font>)
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">ComposeXML</font>(0)
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="extractxmllist.html">ExtractXMLList()</a>, <a href="insertxmlarray.html">InsertXMLArray()</a>, <a href="insertxmlmap.html">InsertXMLMap()</a>, <a href="insertxmlstructure.html">InsertXMLStructure()</a> 

</Blockquote><p><b>Supported OS </b><Blockquote>All</Blockquote></p><center><- <a href=insertxmlarray.html>InsertXMLArray()</a> - <a href="index.html">XML Index</a> - <a href="insertxmlmap.html">InsertXMLMap()</a> -><br><br>

</body></html>